package com.bestdreamer.thread_join;

public class Demo2JoinRun {

    public static void main(String[] args) {
        try{
            Demo2ThreadB threadB = new Demo2ThreadB();
            Demo2ThreadA threadA = new Demo2ThreadA(threadB);
            threadA.start();
            threadB.start();
            threadB.join(2000);
            System.out.println(" main end " + System.currentTimeMillis());
        }catch (InterruptedException e){
            e.printStackTrace();
        }

    }
}
